package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.FindCourseServiceljc;
import com.zr.serviceImpl.FindCourseServiceImplljc;

import net.sf.json.JSONArray;

public class FindcourseControllerljc extends HttpServlet{
	
	// 查询已经存在的课程
	FindCourseServiceljc fs = new FindCourseServiceImplljc();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("utf8");
		resp.setCharacterEncoding("utf8");
		PrintWriter pw =resp.getWriter();
		JSONArray j = fs.FindCourse();
		pw.write(j.toString());
		pw.flush();
		pw.close();
	}
}
